package com.hangxingliu.flashalarm;

import android.content.Context;
import android.text.InputType;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

public final class ViewCreator {
	private static Context context;
	public static void bindContext(Context context){
		ViewCreator.context = context;
	}
	public static LinearLayout cVerticalLayout(){
		LinearLayout ll = new LinearLayout(context);
		ll.setOrientation(LinearLayout.VERTICAL);
		return ll;
	}
	
	public static EditText cNumEditText(String hint){
		EditText et = new EditText(context);
		if(hint != null)
			et.setHint(hint);
		et.setSingleLine(true);
		et.setInputType(InputType.TYPE_CLASS_NUMBER);
		return et;
	}
	
	public static TextView cTextView(String text){
		TextView tv = new TextView(context);
		tv.setText(text);
		return tv;
	}
	
	public static CheckBox cCheckBox(String text){
		CheckBox cb = new CheckBox(context);
		cb.setText(text);
		return cb;
	}
}
